<!DOCTYPE html>
<html lang="zh-cmn-Hans" xmlns:th="http://www.thymeleaf.org">
<head th:replace="manage/common/head"></head>

<body>
<!-- topbar starts -->
<div th:replace="manage/common/topbar"></div>
<!-- topbar ends -->

<div class="page-content">
    <div class="row">
        <div class="col-md-2">
            <div th:replace="manage/common/menu"></div>
        </div>
        <div class="col-md-10">
            <div class="row">
                <div class="col-md-12">
                    <div th:replace="manage/common/box_header"></div>

                    <div class="content-box-large box-with-header">
                        <div class="row">
                            <div class="panel-heading col-md-12">
                                <legend>内容</legend>
                            </div>
                            <input type="hidden" id="groupId" th:value="${group.id}">
                            <div class="col-md-12">
                                <table class="table table-striped">
                                    <thead>
                                    <tr>
                                        <th>URI</th>
                                        <th>权限名</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr th:each="obj : ${groupAuthVOList}">
                                        <td th:text="${obj.uri}"></td>
                                        <td th:text="${obj.authjBean==null?'已失效':obj.authjBean.name}"></td>
                                        <td>
                                            <a class="btn btn-info add" th:if="${not obj.have}"
                                               th:attr="data-uri=${obj.uri}">
                                                添加
                                            </a>
                                            <a class="btn btn-danger remove" th:if="${obj.have}"
                                               th:attr="data-uri=${obj.uri}">
                                                <i class="glyphicon glyphicon-remove"></i>
                                                移除
                                            </a>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>

<footer th:replace="manage/common/footer"></footer>

<!-- external javascript -->
<div th:replace="manage/common/script"></div>
<script type="text/javascript" src="/manage/js/page/mine/group/auth.js"></script>
<script>
    window.onload = function () {

        var groupAuth = new window.controller.GroupAuth();

        groupAuth.init();

    };
</script>

</body>
</html>